package org.biloxi.commands;

/**
 * Command shield the Model from being manipulated directly by MagicObjects or
 * IPlayers. Commands are also CommandEvents for which MagicObjects can attach 
 * {@link CommandListener} to do something when the Command executes.
 * A Command's behavior can be replaced by attaching another Command through the
 * {@link #insteadDo(Command)} method.
 * 
 * @author Peter.WM.Wong@gmail.com
 *
 * @param <O> Options Type to perform the Command
 * @param <T> Result Type holding pertinent data logging the Commands execution.
 *            This is passed to {@link CommandListener}
 */
public interface Command<O,T> extends CommandEventDispatcher<O,T> {	
	
	/**
	 * Allows Cards to modify a the Options before it is passed to the 
	 * Command to execute.
	 * @param om
	 */
	public void modifyOptions(OptionsModifier<O> om);
	
	/**
	 * Allows Cards to override a Command's behavior. 
	 * Example: Replacing the Draw phase.
	 * @param cmd
	 */
	public void insteadDo(CommandOverride<O> cmdOverride);
	
}
